//
//  UIPanel.h
//  storm
//
//  Created by wangdi on 13-8-20.
//
//

#ifndef __storm__UIPanel__
#define __storm__UIPanel__

#include "UIWidget.h"

namespace storm
{
    class UIPanel : public UIWidget, public UIListener
    {
    public:
        virtual void setEnable(bool bEnable);
        virtual void loseFocus();
        virtual void fadeOut(float duration);
        virtual void fadeIn(float duration);
        virtual UIWidget *onReceiveNewTouch(cocos2d::CCTouch *pTouch);
        
    public:
        virtual void visit();
    public:
        UIPanel();
        virtual ~UIPanel();
    
        void SetClipRange(const cocos2d::CCRect &rc) {m_rcClip = rc;}
        const cocos2d::CCRect &ClipRange() {return m_rcClip;}
    public:
        void AddChildWidget(UIWidget *pChild);
    protected:
        WidgetList m_listWidgets;
        cocos2d::CCRect m_rcClip;
    
    };
    
    typedef std::list<UIPanel *> PanelList;
}

#endif /* defined(__storm__UIPanel__) */
